const router = require('koa-router')();
const {db,} = require("../../models/db");


router.post('/contact/changeContactPrintCode', async ctx => {
    let buId = ctx.request.body.buId
    let check = ctx.request.body.check
    let tenantId = ctx.user.tenantId
    let model = await db.models['contact'].findOne({
        where: {
            tenantId,
            id: buId
        }
    })
    if(model) {
        model.printBar = check;
        await model.save()
    }
    ctx.suc('')
})




module.exports = router;